package com.xbongbong.saas.factory.publicrule;

import com.alibaba.fastjson.JSONArray;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.entity.ClueRuleEntity;

import java.util.List;

public interface IOperateClueRuleValue {

    /**
     * 校验格式是否正确
     *
     * @param ruleValue
     */
    void verify(String ruleValue) throws XbbException;

    /**
     * 将存库的String转换成object
     *
     * @param rule
     */
    Object toObject(ClueRuleEntity rule);

    /**
     * 获取开启状态
     *
     * @param clueRule
     */
    Integer getStatus(ClueRuleEntity clueRule);

    /**
     * 获取有线索状态设置
     *
     * @param clueRule
     */
    JSONArray getClueStatus(ClueRuleEntity clueRule);

    /**
     * 获取子类型（所有线索统一设置、根据线索状态设置、根据线索重要程度）
     *
     * @param clueRule
     */
    Integer getType(ClueRuleEntity clueRule);

    /**
     * 获取数值的数组配置
     *
     * @param clueRule
     */
    JSONArray getRestrict(ClueRuleEntity clueRule);

    /**
     * 获取当前选中的所有特殊员工id
     *
     * @param ruleObject
     * @return
     */
    List<String> getAllSpecialUser(Object ruleObject);

    /**
     * 获取规则配置中的标签Id
     *
     * @param ruleObject
     * @return
     */
    List<Long> getClueLabelIds(Object ruleObject);
}
